#include "thread.hpp"
#include <unistd.h>
using namespace threadspace;

int main()
{
    Thread t1([](){
        while(true)
        {
            std::cout << "这是一个新线程" << std::endl;
            sleep(1);
        }
    });
    // 启动
    //t1.Detach();
    t1.Start();
    t1.Detach();
    
    sleep(5);

    t1.Stop();

    t1.Join();
    return 0;
}